<template>
	<view>
		<view class="biaoxx">
			<input class="shuruk"  type="text" placeholder="输入账单名查找" @input="shousuo"/>
			<view class="chakgd">搜索</view>
		</view>
		<view class="jinqls">
			<view class="zhiflius" v-for="item in jjlius" :key="item.id" @click="gozdxiangq(item.id)">
				<view class="neirxx">
					<view class="nirrr">{{item.zflx==1 ? "充值" : "剪头发"}}</view>
					<view class="fukneir">
						<view :class="item.zflx==1?'zhichu':'shour'">{{item.zflx==1 ? item.zfdd.zffs : item.xfdd.mendian.mdname}}</view>
						<view class="ddshij">{{item.ddsj}}</view>
					</view>
				</view>
				<view>
					<view :class="item.zflx==1?'weish':'yish'">{{item.zflx==0?'充值':'消费'}}{{item.money||0.00}}元</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ssk:'',
				yema:1,
				jjlius:[],

			}
		},
		onLoad(){
			this.getYuelist();
		},
		onReachBottom(){
			// this.yema=this.yema+1;
			// this.getliushui(this.yema);
		},
		methods: {
			// 关键字查询
			shousuo(e){
				// var that=this;
				// that.ssk = e.detail.value;
				// uni.request({
				// 	url: getApp().globalData.url+'/api/UsCzmhlis',
				// 	data:{
				// 		openid:getApp().globalData.openid,
				// 		guanjz:e.detail.value
				// 	},
				// 	header: {
				// 	   "Content-Type": "text/html"
				// 	}, 
				// 	success(res) {
				// 		if(res.data.code==200){
				// 			that.jjlius=res.data.data
				// 		}else{
				// 			wx.showToast({
				// 				title: '无查询结果',
				// 				icon: 'none', 
				// 				duration: 2000     
				// 			})  
				// 		}
				// 	}
				// })
			},
			// 获取账单流水
			getYuelist(){
				var that=this;
				uni.request({
					url: getApp().globalData.url+'/client/GetYuelist',
					data:{
						// id: uni.getStorageSync('user_key').id,
						id: 1,
						// yema:yem
					},
					header: {
					   "Content-Type": "text/html"
					}, 
					success(res) {
						if(res.data.code==200) {
							// console.log('账单流水',res.data.data)
							// if(yem==1){
								that.jjlius=res.data.data;
							// }else{
								// that.jjlius=that.jjlius.concat(res.data.data);
							// }
						}else{
							that.jjlius = [];
							// wx.showToast({
							// 	title: '已到底',
							// 	icon: 'none', 
							// 	duration: 2000     
							// })  
						}
					}
				})
			},
			// 查看账单详情
			gozdxiangq(id){
				uni.navigateTo({
					url:'../zdxiangq/zdxiangq?id='+id
				})
			},
			// 添加账单
			gojizhang(){
				uni.navigateTo({
					url:'../addzhangd/addzhangd'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.biaoxx{
		position: fixed;
		top: 44px;
		z-index: 999;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 710rpx;
		padding: 20rpx;
		background: #ffffff;
		.shuruk{
			background: #f0f0f0;
			padding: 20rpx 30rpx;
			width: 480rpx;
			border-radius: 10rpx;
		}
		.chakgd{
			padding: 20rpx 30rpx;
			background: #007AFF;
			border-radius: 10rpx;
			color: #ffffff;
		}
	}
	.jinqls{
		margin-top: 130rpx;
		padding: 47px 20rpx 200rpx 20rpx;
		.zhiflius{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 20rpx;
			border-bottom: solid 1rpx #efefef;
			padding-bottom: 20rpx;
			.yish{
				font-size: 26rpx;
				color: #007AFF;
				font-weight: bold;
			}
			.weish{
				font-size: 26rpx;
				color: #ff58a3;
				font-weight: bold;
			}
			.zhiftb{
				width: 80rpx;
				height: 80rpx;
			}
			.neirxx{
				width: 500rpx;
				margin-top: 10rpx;
				.nirrr{
					font-weight: bold;
				}
				.fukneir{
					display: flex;
					align-items: center;
					font-size: 25rpx;
					.shour{
						color: #1aafff;
					}
					.zhichu{
						color: #ff2baa;
					}
					.ddshij{
						margin-left: 50rpx;
						color: #848484;
					}
				}
			}
		}
	}
</style>
